public class Teacher {
    private String id;
    private String name;
    private String gender;
    private Course course;

    // 构造方法
    public Teacher(String id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    // 开课方法
    public void offerCourse(Course course) {
        this.course = course;
        course.setTeacher(this);
        System.out.println(name + "老师开设了" + course.getCourseName() + "课程");
    }

    // getter 和 setter 方法
    public String getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public Course getCourse() {
        return course;
    }
}